<section class="content">
	<div class="box">
			<div class="box-body">
				<div class="row marginZero">
					<epoch:table id="sysRoleTable" queryUrl="${basePath}/sys/role/findRoleListAjax" rowId="id" showRefresh="true"
					        onDelClick="onDelete" onAddClick="addClick" newBtn="true" delBtn="true">
					        <epoch:tr check="checkbox" titleTip="全选"></epoch:tr>
					        <epoch:tr name="角色名称" formName="role_name">
					            <a href="javascript:void(0);" style="color:#3c8dbc" onclick="viewAddPage('~{row.id}')">~{row.role_name}</a>
					        </epoch:tr>
					        <epoch:tr name="角色编码" formName="role_code"></epoch:tr>
					        <epoch:tr name="描述" formName="comments"></epoch:tr>
					        <epoch:tr name="状态" formName="status" filterType="select"
					            filterData="${lisFun.dictForFilter('PUB_ENABLE_DISABLE')}"></epoch:tr>
					        <epoch:tr name="角色类型" formName="role_type" filterType="select"
					            filterData="${lisFun.dictForFilter('SYS_ROLE_TYPE')}"></epoch:tr>
					        <epoch:tr name="操作" switchable="false">
					             <button class="btn btn-danger btn-xs" onclick="delRows('~{row.id}');">
				                	<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>删除
				              	</button>
					        </epoch:tr>
					</epoch:table>
				</div>
		</div>
	</div>
</section>
<script type="text/javascript">
function viewAddPage(id) {
    if(id!=null){
        _tabs.showPage("information",null,'ID=' + id,null);
    }else {
        _tabs.showPage("information",null,null,null);
    }
}
function delRows(id){
	CommonUtil.del(null, id, "${basePath}/sys/role/delete",null,function(){
        _tabs.showPage("list",null,null,null)});
}
function onDelete(rows) {
	CommonUtil.del(rows, "id", "${basePath}/sys/role/delete",null,function(){
        _tabs.showPage("list",null,null,null)});
}
function addClick(){
	_tabs.showPage("information",null,null,null);	
}
</script>